<?php get_header();?>

<body>
<div id="container">
	<!-- baner -->
	<?php include TEMPLATEPATH.'/views/view-header.php';?>
	<!-- end banner-->
	<!-- menu -->
	<?php include TEMPLATEPATH.'/views/view-menu.php';?>
	<!-- end menu-->
	<!-- flash -->
	<?php include TEMPLATEPATH.'/views/view-banner.php';?>
	<!-- end flash-->
	<!-- content -->
	<div class="first-content">
	<div id="content">
		<!-- box_sanpham_moi -->
		<?php include TEMPLATEPATH.'/views/view-index-san-pham-moi.php';?>
		<div class="shadow_spmoi"><img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/bg_shadow_sp.jpg" alt="" /></div>
		<!-- box_sanpham_moi -->
		<!-- left_comlumds -->
		<?php get_sidebar();?>
		<!--end left_comlumds -->
		<!-- right_comlumds -->
		<div class="right_comlumds">
			<!-- right_box_1 -->
			<div class="box_1_right">
				<div class="title_right">
					<img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/left_title_c.jpg" alt="" />
					<div class="right_title_r2">
						<img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/icon_title.jpg" alt="" />
						Giới thiệu công ty
					</div>
				</div>
				<div class="content_about">
				<?php 
				$page_about = get_page_by_path("gioi-thieu");
				echo apply_filters('the_content', $page_about->post_content);
				?>				
				
				</div>
			</div>
			<!-- end right_box_1 -->
			<!-- right_box2 -->
			<?php 
			// Cong trinh tieu bieu
			$congtrinhtieubieu = db_query_all_post_in_post_type(6, 'projects', 'date', 'DESC', $wpdb->prefix.'project-hot', 'display');
			//query_posts($congtrinhtieubieu);
			$myquery = new WP_Query($congtrinhtieubieu);
			?>
			<div class="box_1_right">
				<div class="title_right">
					<img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/left_title_c.jpg" alt="" />
					<div class="right_title_r2">
						<img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/icon_title.jpg" alt="" />
						Công trình tiêu biểu
					</div>
				</div>
				<?php 
				if($myquery->have_posts())
				{
					$step = 1;
					echo '<div class="content_about">';
					while ($myquery->have_posts())
					{
						$myquery->the_post();
						$post_id = get_the_ID();
						$title = get_the_title($post_id);
						$perlink = get_permalink($post_id);
						$alt = db_get_alt_attachment_id($post_id, $wpdb->prefix.'thumbnail');
						if(!$alt)
							$alt = db_vietnamese_slug($title);
						$thumbnail = db_get_post_meta($post_id, $wpdb->prefix.'thumbnail');	
						$index_new = get_post_meta($post_id,$wpdb->prefix.'index-new',true);
						if($step==1)
						{
						?>						
							<?php 
							if($thumbnail)
							{
							?>
							
							<?php echo db_get_thumbnail($thumbnail,$alt,253,200);?>
							<?php 
							}
							?>
							<h2><a href="<?php echo $perlink;?>"><?php echo $title;?></a></h2>
							<?php 
							echo db_shortDesc(get_the_content(), 800);
							?>
							<div class="bottom_thicong">
								<h2>Các công trình khác</h2>
						<?php 
						}
						else if($step!=1)
						{
						?>
						<div class="congtrinh1">
							<img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/icon_thicong.jpg" alt="" />
							<p><a href="<?php echo $perlink;?>" title="<?php echo $title;?>"><?php echo $title;?> </a></p>
							<?php 
							if($index_new=='display')
							{
							?>
							<img class="new_icon" src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/icon_new.jpg" alt="" />
							<?php 
							}
							?>
						</div>
						<?php 	
						}
						?>	
					
				<?php 
						$step++;
					}
					echo '</div></div>';
					wp_reset_query();
					$congtrinhtieubieu='';
				}
				?>
			</div>
			<!-- end right_box_2 -->
			<!-- right_box_bottom1 -->
			<?php include TEMPLATEPATH.'/views/view-index-bottom.php';?>
			<!-- end right_box_bottom1 -->
		</div>
		<!-- right_comlumds -->
	</div>
	</div>
	<!-- end content-->
	<?php get_footer();?>
